import request from "@/utils/request";

enum API {
  add_news = "/add_news",
  manage_news_list = "/manage_news_list",
  news_detail = "/news_detail",
  update_news = "/update_news",
  operation_news = "/operation_news",
  delete_news_file="/delete_news_file",
  upload_file = "/upload_file",
}

// 更新文件
export const upload_file = (data) => request.post(API.upload_file, data);

// 新增新闻
export const add_news = (data) => request.post(API.add_news, data);

//后台新闻列表
export const manage_news_list = (params) =>
  request.get(API.manage_news_list, { params });

//新闻详情
export const news_detail = (params) => request.get(API.news_detail, { params });

// 新增新闻
export const update_news = (data) => request.post(API.update_news, data);

// 审核操作新闻
export const operation_news = (data) => request.post(API.operation_news, data);

// 删除新闻关联的一个文件
export const delete_news_file= (params) => request.delete(API.delete_news_file, { params });
